/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "hos_stock_medicamentos")
@NamedQueries({
    @NamedQuery(name = "HosStockMedicamentos.findAll", query = "SELECT h FROM HosStockMedicamentos h")})
public class HosStockMedicamentos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "hsm_id")
    private Integer hsmId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "hsm_cantidad")
    private int hsmCantidad;
    @Basic(optional = false)
    @NotNull
    @Column(name = "hsm_estado")
    private int hsmEstado;
    @OneToMany(mappedBy = "hosStockMedicamentos", fetch = FetchType.LAZY)
    private List<HosAdministracionFarmacos> hosAdministracionFarmacosList;
    @JoinColumn(name = "fed_id", referencedColumnName = "fed_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private FarEgresoDetalle farEgresoDetalle;

    public HosStockMedicamentos() {
    }

    public HosStockMedicamentos(Integer hsmId) {
        this.hsmId = hsmId;
    }

    public HosStockMedicamentos(Integer hsmId, int hsmCantidad, int hsmEstado) {
        this.hsmId = hsmId;
        this.hsmCantidad = hsmCantidad;
        this.hsmEstado = hsmEstado;
    }

    public Integer getHsmId() {
        return hsmId;
    }

    public void setHsmId(Integer hsmId) {
        this.hsmId = hsmId;
    }

    public int getHsmCantidad() {
        return hsmCantidad;
    }

    public void setHsmCantidad(int hsmCantidad) {
        this.hsmCantidad = hsmCantidad;
    }

    public int getHsmEstado() {
        return hsmEstado;
    }

    public void setHsmEstado(int hsmEstado) {
        this.hsmEstado = hsmEstado;
    }

    public List<HosAdministracionFarmacos> getHosAdministracionFarmacosList() {
        return hosAdministracionFarmacosList;
    }

    public void setHosAdministracionFarmacosList(List<HosAdministracionFarmacos> hosAdministracionFarmacosList) {
        this.hosAdministracionFarmacosList = hosAdministracionFarmacosList;
    }

    public FarEgresoDetalle getFarEgresoDetalle() {
        return farEgresoDetalle;
    }

    public void setFarEgresoDetalle(FarEgresoDetalle farEgresoDetalle) {
        this.farEgresoDetalle = farEgresoDetalle;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (hsmId != null ? hsmId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HosStockMedicamentos)) {
            return false;
        }
        HosStockMedicamentos other = (HosStockMedicamentos) object;
        if ((this.hsmId == null && other.hsmId != null) || (this.hsmId != null && !this.hsmId.equals(other.hsmId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.HosStockMedicamentos[ hsmId=" + hsmId + " ]";
    }
    
}
